<style type="text/css">
div.footer-link-group {
    min-width: 170px;
    min-height:150px;
    float:left;
}
div.footer-link-group b {
    font-size: 14px;
    color:white;
    line-height: 30px;
    text-decoration: underline;
}
div.footer-link-group ul {
    color:#cccccc;
}
div.footer-link-group ul li {
    color:#cccccc;
    line-height: 18px;
    font-size: 12px;
    list-style: none;
}
div.footer-link-group ul li a {
    color:#cccccc;
    text-decoration: none;
}
div.footer-link-group ul li a:hover {
    color:white;
}
div.footer-link-group ul li a:visited {
    color:white;
}
</style>
<div style="height:20px;"></div>
<div style="width: 700px; min-height:150px; margin:auto;">
<?php
  $query = "SELECT title,link,parentid,level,menuid FROM menu where menutypeid = 4 and isactive = 1 and isdeleted = 0 and parentid=0";
  $result = mysql_query($query);
  $menusayisi = mysql_num_rows($result);

    while($field=mysql_fetch_array($result)){
        echo "<div class=\"footer-link-group\">";
     echo "<b>". $field[title] ."</b>";
	 $query1 = "SELECT title,link,parentid,level FROM menu where menutypeid = 4 and isactive = 1 and isdeleted = 0 and parentid=".$field[menuid]."";
     $result1 = mysql_query($query1);
	 echo"<ul>";
	   while($field1=mysql_fetch_array($result1)){
	     echo "<li><a href=\"$field1[link]\">$field1[title]</a></li>";
	   }
       echo "</ul>";
       echo "</div>";
    }
?>
<div style="clear: both;"></div>
</div>